package tasktwo;

import java.util.Scanner;

public class tasktwo{

    public static String Fan(boolean A,String B,int c,double r){
        String F=new String(),f=new String();
        F="speed: " +  c+ ", color: " + B + ", radius: " + r ;
        f="fan is off, color: " +  B + ", radius: " +  r;
        if(A)
            return F.toString();

        return f.toString();

    }


    public static void main(String[] args) {
        final int SLOW=1;
        final int MEDIUM=2;
        final int FAST=3;
        int speed=SLOW;
        double radius=5.0;
        boolean on=false;
        String color="blue";
        Scanner input=new Scanner(System.in);
        String f1,f2;
        f1=Fan(on,color,speed,radius);
        System.out.println("Enter properties for Fan 2:");
// 提示用户输入属性
        System.out.print("Is the fan on? (true/false): ");
        on=input.nextBoolean();
        System.out.print("Enter speed (1: SLOW, 2: MEDIUM, 3: FAST): ");
        speed=input.nextInt();
        System.out.print("Enter radius: ");
        radius=input.nextDouble();
        System.out.print("Enter color: ");
        color=input.next();
// 输出风扇的状态
        f2=Fan(on, color, speed, radius);
        System.out.println("Fan 1: " + f1);
        System.out.println("Fan 2: " + f2);


    }
}
